<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /*缩进*/

        details {
            padding-left: 24px;
        }

        /*+ - 按钮*/
            /*隐藏默认三角*/
            ::-webkit-details-marker {
                display: none;
            }
            /*渐变生成+按钮*/
            summary::before {
                content: '';
                display: inline-block;
                width: 12px; height: 12px;
                border: 1px solid #999;
                background: 
                    linear-gradient(to right, #999, #999) no-repeat center, 
                    linear-gradient(to top, #999, #999) no-repeat center;
                background-size: 2px 10px, 10px 2px;
                vertical-align: -2px;
                margin-right: 6px;
                margin-left: -20px;
            }
            /*渐变生成-按钮*/
            [open] > summary::before {
                background: linear-gradient(to right, #999, #999) no-repeat center;
                background-size: 10px 2px;
            }
            [open] > details {
                border-left: 1px dashed black;
                margin-left: -15px; 
            }

    </style>
</head>

<body>
    <details>
        <summary>0-0</summary>
        <details>
            <summary>0-1</summary>
            <details>
                <summary>0-1-0</summary>
            </details>
        </details>
        <details>
            <summary>0-2</summary>
            <details>
                <summary>0-2-0</summary>
            </details>
        </details>
    </details>
</body>
<script>
    // 展开折叠 css实现
    /*
        多个detail嵌套实现
        缩进
        小三角变为+ -
        同级连线的效果
        ===》 扩展 dashed 虚线只能改变线粗细 自定义呢~ 
              比如———— ———— ———— 虚实比例如左  
              可以借助渐变
    */
</script>

</html>